package com.study.hot.newActivity

import android.graphics.Bitmap
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.ActivityResultRegistry
import androidx.activity.result.contract.ActivityResultContracts
import androidx.lifecycle.LiveData

/**
 * <pre>
 *     author : slx
 *     time   : 2020/04/13
 *     desc   : 使用LiveData接口
 * </pre>
 */
class TakePhotoLivedata(
        private val activityResultRegistry: ActivityResultRegistry
) : LiveData<Bitmap?>() {
    lateinit var activityResultLauncher: ActivityResultLauncher<Void?>
    /* override fun onActive() {
         super.onActive()
         activityResultLauncher = activityResultRegistry.registerActivityResultCallback("key",
                 ActivityResultContracts.TakePicture()) { bitmap ->
             value = bitmap
         }
     }

     override fun onInactive() {
         super.onInactive()
         activityResultLauncher.dispose()
     }*/
}